<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <!-- 以借助 script 标签直接通过 CDN 来使用 Vue： -->
    <script src="../JS框架/JS/vue.js"></script>
  </head>
  <body>
    <div id="app">
      <h2>Hello, {{ message}}</h2>
      <input
        type="text"
        placeholder="按下回车提示输入"
        @keyup.enter="showInfo"
      />
    </div>

    <script>
      Vue.createApp({
        data() {
          return {
            message: "wrod",
          };
        },
        methods: {
          showInfo(e) {
            // if (e.keyCode !== 13) return;
            console.log(e.target.value);
          },
        },
      }).mount("#app");
    </script>
  </body>
</html>
